/**
 * @summary 评论模块
 * @author  ll
 */

import { getCommentsList } from '@/api/comments';

export default {
  namespaced: true,
  state: {
    // 评论列表
    commentsList: [],
  },
  mutations: {
    SET_COMMENTS_LIST(state, newValue) {
      state.commentsList = newValue;
    },
  },
  actions: {
    async updateCommentsList(context, id) {
      const res = await getCommentsList(id);
      context.commit('SET_COMMENTS_LIST', res);
    },

  }
}
